﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.ReworkManagement;

namespace Digitalmes.Model.ReworkManagement
{
    /// <summary>
    /// 返工类型
    /// </summary>
	[Table("ReworkType")]

    [Display(Name = "_Model.ReworkType")]
    public class ReworkType : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._ReworkType._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._ReworkType._ReworkTypeCode")]
        [Comment("返工类型")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ReworkTypeCode { get; set; }
        [Display(Name = "_Model._ReworkType._TypeDesc")]
        [Comment("返工说明")]
        public string TypeDesc { get; set; }
        [Display(Name = "_Model._ReworkReason._ReType")]
        [InverseProperty("ReType")]
        public List<ReworkReason> ReworkReason_ReType { get; set; }
        [Display(Name = "_Model._ReworkData._ReType")]
        [InverseProperty("ReType")]
        public List<ReworkData> ReworkData_ReType { get; set; }
        [Display(Name = "_Model._ReworkType._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
